package com.getword;

public class Demo3
{
    // 论证：线程终端
    public static void main(String[] args)
        throws InterruptedException
    {
        Thread th1 = new Thread(() ->
        {
            for (;;)
            {
            }
        });
        th1.start();
        th1.interrupt();
        System.out.println(th1.isInterrupted());  // true
        System.out.println(th1.interrupted());  // false
        System.out.println(th1.isInterrupted());  // true
        System.out.println(Thread.currentThread().isInterrupted()); // false
        th1.join();
    }
}
